﻿<!-- #include virtual="/Inc/conn.asp"-->
<!-- #include virtual="/Inc/md5.asp"-->
<!-- #include virtual="/Inc/function.asp"-->
<!-- #include virtual="/Inc/config.asp"-->
<!-- #include virtual="/Inc/Admin/common.asp"-->
<%
Dim t_value
Dim ptitle,pdate
sql="select * from db_tplportlet where id=" & clng(Request("ID"))
set rs = Server.CreateObject("adodb.recordset")
rs.Open sql,conn,1,1
if not rs.eof then

if rs("type")="html" then
	response.write rs("tvalue")
elseif rs("type")="top" then
	response.write "<ul>"
	t_value=split(rs("tvalue"),":")
	sql1="select top " & t_value(1) & " * from db_page where pageID=" & t_value(0)
	set rs1 = Server.CreateObject("adodb.recordset")
	rs1.Open sql1,conn,1,1
	do while not rs1.eof
	ptitle=rs1("title")
	if len(ptitle)>t_value(2) then ptitle=left(ptitle,t_value(2)) & "..."
	%>
	<li><a href="#"><%=ptitle%></a></li>
	<%
	rs1.movenext
	loop
	rs1.close
	response.write "</ul>"
elseif rs("type")="pic" then
	t_value=split(rs("tvalue"),":")
	Dim swf_height:swf_height=t_value(4)+18
	Dim imags,links,texts:imags="":links="":texts=""
	sql1="select top " & t_value(1) & " * from db_page where pageID=" & t_value(0)
	set rs1 = Server.CreateObject("adodb.recordset")
	Dim i:i=1
	rs1.Open sql1,conn,1,1
	do while not rs1.eof
		picurl=rs1("pic")
		ptitle=rs1("title")
		if len(ptitle)>t_value(2) then ptitle=left(ptitle,t_value(2)) & "..."
		imags=imags & picurl & "|"
		links=links & "#|"
		texts=texts & ptitle & "|"
		i=i+1
		rs1.movenext
	loop
	rs1.close
	imags=left(imags,len(imags)-1)
	links=left(links,len(links)-1)
	texts=left(texts,len(texts)-1)
	%>
	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="<%=t_value(3)%>" height="<%=swf_height%>">
	<param name="allowScriptAccess" value="sameDomain"/><param name="movie" value="/swf/picviewer.swf"/><param name="quality" value="high"/><param name="bgcolor" value="#DADADA"/>
	<param name="menu" value="false"/><param name="wmode" value="opaque"/>
	<param name="FlashVars" value="pics=<%=imags%>&links=<%=links%>&texts=<%=texts%>&borderwidth=<%=t_value(3)%>&borderheight=<%=t_value(4)%>&textheight=18"/>
	<embed src="/swf/picviewer.swf" wmode="opaque" FlashVars="pics=<%=imags%>&links=<%=links%>&texts=<%=texts%>&borderwidth=<%=t_value(3)%>&borderheight=<%=t_value(4)%>&textheight=18" menu="false" bgcolor="#DADADA" quality="high" width="<%=t_value(3)%>" height="<%=swf_height%>" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
	</object>
	<%
elseif rs("type")="list" then
	response.write "<ul>"
	t_value=split(rs("tvalue"),":")
	ptitle="中创动网络科技有限公司推出全新的CMS内容管理系统KnifeCMS.ASP"
	pdate=""
	if len(ptitle)>clng(t_value(1)) then ptitle=left(ptitle,t_value(1)) & "..."
	if t_value(2)="1" then pdate="2012-09-06"
	for i=1 to clng(t_value(0))
		response.write "	<li><a href=""#"">" & ptitle & "</a>" & pdate & "</li>"
	next
	response.write "</ul>"
	response.write "<div id=""page"">"
	response.write "	<a href=""#"">首页</a>"
	response.write "	<a href=""#"">1</a>"
	response.write "	<a href=""#"">2</a>"
	response.write "	<a href=""#"">3</a>"
	response.write "	……"
	response.write "	<a href=""#"">末页</a>"
	response.write "</div>"
elseif rs("type")="page" then
    t_value=split(rs("tvalue"),":")
	Dim p_title,p_pic,p_content
	p_title=false:p_pic=false:p_content=false
	for k=0 to ubound(t_value)
		select case t_value(k)
			case "title" p_title=true
			case "pic" p_pic=true
			case "content" p_content=true
		end select
	next
	if p_title = true then response.write "<h3>中创动网络科技有限公司</h3>"
	if p_pic = true then response.write "<p><img src=""/Admin/images/nopic.jpg"" width=""180""/></p>"
	if p_content = true then response.write "<div>KnifeCMS.ASP是一款业内领先的开源免费的CMS产品，您可以将其使用在商业用途，唯一的条件就是，当您修改它时，请告知我们对其的改进，以便它不断成长壮大！</div>"
elseif rs("type")="doc" then
    t_value=split(rs("tvalue"),":")
	Dim d_title,d_author,d_date,d_pic,d_self,d_content
	d_title=false:d_author=false:d_date=false:d_pic=false:d_self=false:d_content=false
	for k=0 to ubound(t_value)
		select case t_value(k)
			case "title" d_title=true
			case "author" d_author=true
			case "date" d_date=true
			case "pic" d_pic=true
			case "self" d_self=true
			case "content" d_content=true
		end select
	next
	if d_title = true then response.write "<h3>中创动网络科技有限公司</h3>"
	if d_author = true then response.write "<span>作者：author</span>"
	if d_date = true then response.write "<span>发布时间：2012-11-08</span>"
	if d_pic = true then response.write "<p><img src=""/Admin/images/nopic.jpg"" width=""180""/></p>"
	if d_self = true then response.write "<p>【自定义字段】</p>"
	if d_content = true then response.write "<div>KnifeCMS.ASP是一款业内领先的开源免费的CMS产品，您可以将其使用在商业用途，唯一的条件就是，当您修改它时，请告知我们对其的改进，以便它不断成长壮大！</div>"
elseif rs("type")="form" then
	response.write "<iframe src=""/form/index.asp?id=" & rs("tvalue") & """ width=""100%"" height=""100%"" frameborder=""0""></iframe>"
elseif rs("type")="vote" then
	ID=rs("tvalue")
	%>
	<!--#include file="preview_vote.asp"-->
	<%
elseif rs("type")="gbook" then
	%>
	<!--#include file="preview_gbook.asp"-->
	<%
end if

else
%>
<span>组件已删除，请从设计界面移除，以免造成未知问题！</span>
<%
end if
rs.close
%>